﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace CustomsExplorer.Settings
{
    internal static class MasterDBHelper
    {
        public static List<MasterDBConnectionInfo> GetMasterConnectionsFromConfig()
        {
            List<MasterDBConnectionInfo> conns = new List<MasterDBConnectionInfo>();
            string[] configCons = ConfigurationSettings.AppSettings.AllKeys.Where(key => key.StartsWith("CONNECTION")).ToArray();
            foreach (string conn in configCons)
                conns.Add(new MasterDBConnectionInfo(ConfigurationSettings.AppSettings[conn], null, true));
            return conns;
        }
    }
}
